<%@ page language="java" import="java.util.*,com.gdpu.project.util.DateUtil1" pageEncoding="UTF-8"%>
<%@page import="com.gdpu.page.vo.ScoreIndex"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>科研分列表</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.tabfont01 {	
	font-family: "宋体";
	font-size: 9px;
	color: #555555;
	text-decoration: none;
	text-align: center;
}
.font051 {font-family: "宋体";
	font-size: 12px;
	color: #333333;
	text-decoration: none;
	line-height: 20px;
}
.font201 {font-family: "宋体";
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.button {
	font-family: "宋体";
	font-size: 14px;
	height: 37px;
}
html { overflow-x: auto; overflow-y: auto; border:0;} 
-->
</style>

<link href="<%=basePath %>admin/achievementManager/css/css.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>admin/achievementManager/css/style.css" rel="stylesheet" type="text/css" />
</head>
<SCRIPT language=JavaScript>
	function autoRowSpan(tb,row,col){
<%--		alert("**********");--%>
	    var lastValue=null;
	    var value="";
	    var pos=1;
	    var score=0.0;
	    for(var i=row;i<tb.rows.length;i++){
	    	var row_i=tb.rows[i].cells[col];
	    	if(row_i!=null){
		    		 value = row_i.innerText;
		    	     
		        if(lastValue == value){
		            tb.rows[i].deleteCell(col+3);
		            tb.rows[i-pos].cells[col+3].rowSpan = tb.rows[i-pos].cells[col+3].rowSpan+1;
		            pos++;
		        }else{
		        	if(lastValue!=null){
		        		tb.rows[i-pos].cells[col+3].innerText=score;
		        		score=0.0;
		        	}
		        	lastValue = value;
		            pos=1;
		        }
		        score = score+parseFloat(tb.rows[i].cells[col+1].innerText);
		        if(i==tb.rows.length-1){
		        	var cel=tb.rows[i-1].cells[col+3];
		        	tb.rows[i-pos+1].cells[col+3].innerText=score;
		        	score=0.0;
		        }
	       }
	    }
	}
</SCRIPT>

<body onload="autoRowSpan(data,2,3)">
<form name="fom" id="fom" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="40" class="font42">
				<table id="data" " width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">
				 <tr class="CTitle" >
                    	<td height="22" colspan="7" align="center" style="font-size:16px">科研分列表(${timeScope})</td>
                  </tr>
                  <tr bgcolor="#EEEEEE">
				    <td width="5%" align="center" height="20">序号</td>
                    <td width="19%" align="center">类别</td>
					<td width="19%" align="center">成果名称</td>
                    <td width="15%" align="center">角色</td>
                    <td width="15%" align="center">科研分</td>
                    <td width="19%" align="center">级别</td>
                    <td width="8%" align="center">总分</td>
                  </tr>
                  <%	List<ScoreIndex> scorelist = (List<ScoreIndex>)request.getAttribute("scorelist");
                  		int count = 1;
                  		if(scorelist.size()>0){
                  			Iterator<ScoreIndex> score = scorelist.iterator();
                  			float j=0;
                  			int i=1;
                  			while(score.hasNext()){
                  				ScoreIndex s = score.next();
                  				
                   %>
                  <tr bgcolor="#FFFFFF">
				    <td height="16" align="center"><%=count %></td>
                    <td  align="center"><%=s.getCategory()==null ? "" : s.getCategory() %></td>
                    <td align="center" bgcolor="#FFFFFF"><%=s.getName()==null ? "" : s.getName() %></td>
                    <td align="center" bgcolor="#FFFFFF"><%=s.getAuthor()==null ? "" : s.getAuthor()%></td>
                    <td align="center" bgcolor="#FFFFFF"><%=s.getScore()==null ? "" : s.getScore() %></td>
                    <td align="center" bgcolor="#FFFFFF"><%=s.getLevel()==null ? "" : s.getLevel() %></td>
                    <td align="center" bgcolor="#FFFFFF" ></td>
                    <%--
                    
<%--                    <%--%>
<%--	                    if(s.getAuthor()!=null&&score.hasNext()&&s.getAuthor().equals(score.next().getAuthor())){--%>
<%--	                    	i++;--%>
<%--	                    	j=j+Float.parseFloat(s.getScore());--%>
<%--	      			%>		--%>
	                 		
<%--	                 <%   	--%>
<%--	      				}else if(){--%>
<%--	      			%>--%>
<%--	      					<td align="center" bgcolor="#FFFFFF" rowspan="<%=i %>"><%=j%></td>--%>
<%--	      			<%	--%>
<%--	      					i=1;--%>
<%--	      				}--%>
<%--                    %>--%>
                  </tr>
                  <%
                  		count++;
                  }}else{ %>
                  <tr bgcolor="#FFFFFF"><td colspan="7" align="center">暂无数据......</td></tr>
                  <%} %>
            </table></td>
        </tr>
        
 
      </table>
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="6"><img src="../images/spacer.gif" width="1" height="1" /></td>
        </tr>
        <tr>
          <td height="33"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="right-font08">
          </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
